package com.hk.system.controller;

import dubhe.token.core.util.SecurityContextUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author miaoj
 */
@RestController
@RequestMapping(path = "/rest/user-info")
@Tag(name = "获取当前登录用户信息", description = "获取当前登录用户信息")
@Slf4j
@RequiredArgsConstructor
public class UserInfoController {

    @Operation(summary = "获取当前登录用户", description = "获取当前登录用户")
    @GetMapping
    public Object get() {
        return SecurityContextUtil.getCurrentUserInfo();
    }
}
